﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.IO.Packaging;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;

namespace com.codeplex.ssse.BL
{
    public class WordParser
    {
        public WordParser()
        {

        }

        public string ParseDOC(string filename)
        {
            string allStrings = "";

            using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(filename, false))
            {
                Body body = wordDoc.MainDocumentPart.Document.Body;
                List<Paragraph> paras = body.Elements<Paragraph>().ToList<Paragraph>();

                allStrings = body.ToString();
            }

                

            return allStrings;

        }
    }
}
